package com.entity;
// Generated 2020-3-7 22:53:22 by Hibernate Tools 3.6.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * Dynamic generated by hbm2java
 */
@Entity
@Table(name = "dynamic", catalog = "platform")
public class Dynamic implements java.io.Serializable {

	/**
	 * 
	 */
//	private static final long serialVersionUID = 1L;
	private int did;
	private User user;
	private String releaseTime;
	private Integer good;
	private String content;
	private Integer examine;
	private String photo;
	private Set<Comment> comments = new HashSet<Comment>(0);

	public Dynamic() {
	}

	public Dynamic(int did, User user, String releaseTime) {
		this.did = did;
		this.user = user;
		this.releaseTime = releaseTime;
	}

	public Dynamic(int did, User user, String releaseTime, Integer good, String content, Integer examine, String photo,
			Set<Comment> comments) {
		this.did = did;
		this.user = user;
		this.releaseTime = releaseTime;
		this.good = good;
		this.content = content;
		this.examine = examine;
		this.photo = photo;
		this.comments = comments;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "did", unique = true, nullable = false)
	public int getDid() {
		return this.did;
	}

	public void setDid(int did) {
		this.did = did;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "uid", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "releaseTime", nullable = false)
	public String getReleaseTime() {
		return this.releaseTime;
	}

	public void setReleaseTime(String releaseTime) {
		this.releaseTime = releaseTime;
	}

	@Column(name = "good", nullable = false)
	public Integer getGood() {
		return this.good;
	}

	public void setGood(Integer good) {
		this.good = good;
	}

	@Column(name = "content")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "examine", nullable = false)
	public Integer getExamine() {
		return this.examine;
	}

	public void setExamine(Integer examine) {
		this.examine = examine;
	}

	@Column(name = "photo")
	public String getPhoto() {
		return this.photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "dynamic")
	public Set<Comment> getComments() {
		return this.comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

}
